import Vue from 'vue'
import VueRouter from 'vue-router'
import cacheUtil from '@/utils/cache'
import { Message } from 'element-ui'

Vue.use(VueRouter)

const level = cacheUtil.getItem('status') * 1

function redirectF(children) {
  if (cacheUtil.getItem('menu')) {
    const tree = JSON.parse(cacheUtil.getItem('menu'))
    for (let i = 0; i < children.length; i++) {
      if (checkMenu(tree, children[i].id)) {
        return children[i].path
      }
    }
  }
}

function redirectH(children) {
  if (cacheUtil.getItem('menu')) {
    const tree = JSON.parse(cacheUtil.getItem('menu'))
    for (let i = 0; i < children.length; i++) {
      const l = []
      const [a, ...ids] = children[i].ids
      // children[i].ids.map((item) => {
      ids.forEach((item) => {
        const node = checkMenu(tree, item)
        l.push(node)
      })
      const find = l.find((e) => {
        return e
      })
      if (find) {
        return children[i].path
      } else {
        // return false
      }
      // if (checkMenu(tree, children[i].id)) {
      //     return children[i].path
      // }
    }
  }
}

function checkMenu(tree, id) {
  var isGet = false
  var retNode = null

  function deepSearch(tree, id) {
    for (let i = 0; i < tree.length; i++) {
      if (tree[i].children && tree[i].children.length > 0) {
        deepSearch(tree[i].children, id)
      }
      // eslint-disable-next-line eqeqeq
      if (id == tree[i].pkid || isGet) {
        isGet || (retNode = tree[i])
        isGet = true
        break
      }
    }
  }
  deepSearch(tree, id)
  return retNode ? retNode.hasPri : false
}

const childrenOne = [
  // {
  //   name: 'now',
  //   id: '411',
  //   path: '/cockpit/now',
  //   component: () => import('@/views/cockpit/now/index.vue')
  // },
  // {
  //   name: 'plan',
  //   id: '412',
  //   path: '/cockpit/plan',
  //   component: () =>
  //     import('@/views/cockpit/plan/index.vue')
  // },
  // {
  //   name: 'bim',
  //   id: '413',
  //   path: '/cockpit/bim',
  //   component: () => import('@/views/cockpit/bim/index.vue')
  // },
  // {
  //   name: 'proj',
  //   id: '414',
  //   path: '/cockpit/proj',
  //   component: () =>
  //     import('@/views/cockpit/proj/index.vue')
  // }

  {
    name: 'panorama',
    id: '411',
    meta: { id: '411' },
    path: '/cockpit/panorama',
    component: () =>
      import('@/views/cockpit/panorama/index.vue')
  },
  {
    name: 'blueprint',
    id: '412',
    meta: { id: '412' },
    path: '/cockpit/blueprint',
    component: () =>
      import('@/views/cockpit/blueprint/index.vue')
  },
  {
    name: 'digitaltwin',
    id: '413',
    meta: { id: '413' },
    path: '/cockpit/digitaltwin',
    component: () =>
      import('@/views/cockpit/digitaltwin/index.vue')
  },
  {
    name: 'growth',
    id: '414',
    meta: { id: '414' },
    path: '/cockpit/growth',
    component: () =>
      import('@/views/cockpit/growth/index.vue')
  },
  {
    name: 'iot',
    id: '415',
    meta: { id: '415' },
    path: '/cockpit/iot',
    component: () => import('@/views/cockpit/iot/index.vue')
  }
]
// 原智慧运维
const childrenTwo = [
  {
    name: 'userManagement',
    id: '441',
    meta: { id: '441' },
    path: '/mochaITOM/userManagement',
    component: () =>
      import('@/views/mochaITOM/userManagement/index')
  },
  {
    name: 'roleManagement',
    id: '442',
    meta: { id: '442' },
    path: '/mochaITOM/roleManagement',
    component: () =>
      import('@/views/mochaITOM/roleManagement/index')
  },
  {
    name: 'deptManagement',
    id: '443',
    meta: { id: '443' },
    path: '/mochaITOM/deptManagement',
    component: () =>
      import('@/views/mochaITOM/deptManagement/index')
  },
  {
    name: 'mapManagement',
    id: '4441',
    meta: { id: '4441' },
    path: '/mochaITOM/mapManagement',
    component: () =>
      import('@/views/mochaITOM/mapManagement/index')
  },
  {
    name: 'userManagement',
    id: '445',
    meta: { id: '445' },
    path: '/mochaITOM/userRecord',
    component: () =>
      import('@/views/mochaITOM/userManagement/record')
  },
  {
    name: 'userManagement',
    id: '445',
    meta: { id: '445' },
    path: '/mochaITOM/userDetail',
    component: () =>
      import('@/views/mochaITOM/userManagement/detail')
  },
  {
    name: 'userManagement',
    id: '445',
    meta: { id: '445' },
    path: '/mochaITOM/userOperation',
    component: () =>
      import('@/views/mochaITOM/userManagement/operation')
  },
  {
    name: 'catalogueManagement',
    id: '4442',
    meta: { id: '4442' },
    path: '/mochaITOM/catalogueManagement',
    component: () =>
      import('@/views/mochaITOM/catalogueManagement/index')
  },
  {
    name: 'catalogueManagement',
    id: '4442',
    meta: { id: '4442' },
    path: '/mochaITOM/catalogueRecord',
    component: () =>
      import('@/views/mochaITOM/catalogueManagement/record')
  },
  {
    name: 'catalogueManagement',
    id: '4442',
    meta: { id: '4442' },
    path: '/mochaITOM/catalogueManagement/catalogueAllocation',
    component: () =>
      import(
        '@/views/mochaITOM/catalogueManagement/catalogueAllocation'
      )
  },
  {
    name: 'catalogueManagement',
    id: '4442',
    meta: { id: '4442' },
    path: '/mochaITOM/catalogueManagement/catalogueDataAllocation',
    component: () =>
      import(
        '@/views/mochaITOM/catalogueManagement/catalogueDataAllocation2'
      )
  },
  {
    name: 'catalogueManagement',
    id: '4442',
    meta: { id: '4442' },
    path: '/mochaITOM/catalogueManagement/serveMount',
    component: () =>
      import(
        '@/views/mochaITOM/catalogueManagement/serveMount'
      )
  },
  {
    name: 'assetsManagement',
    id: '4443',
    meta: { id: '4443' },
    path: '/mochaITOM/assetsManagement',
    component: () =>
      import('@/views/mochaITOM/assetsManagement')
  },
  {
    name: 'assetsManagement',
    id: '4443',
    meta: { id: '4443' },
    path: '/mochaITOM/assetsManagement/assetAllocation',
    component: () =>
      import(
        '@/views/mochaITOM/assetsManagement/assetAllocation'
      )
  },
  {
    name: 'padBasemap',
    id: '4461',
    meta: { id: '4461' },
    path: '/mochaITOM/padManagement/basemap',
    component: () =>
      import(
        '@/views/mochaITOM/padManagement/basemap/index'
      )
  },
  {
    name: 'padCatalog',
    id: '4462',
    meta: { id: '4462' },
    path: '/mochaITOM/padManagement/catalog',
    component: () =>
      import(
        '@/views/mochaITOM/padManagement/catalog/index'
      )
  },
  {
    name: 'appManagement',
    id: '4463',
    meta: { id: '4463' },
    path: '/mochaITOM/padManagement/appManagement',
    component: () =>
      import('@/views/mochaITOM/padManagement/app/index')
  }
]
// 原智慧建设
const childrenThree = [
  {
    name: 'proj',
    id: '431',
    meta: { id: '431' },
    path: '/wisdomBuild/proj',
    component: () =>
      import('@/views/wisdomBuild/proj/index.vue')
  },
  {
    name: 'safe',
    id: '432',
    meta: { id: '432' },
    path: '/wisdomBuild/safe',
    component: () =>
      import('@/views/wisdomBuild/safe/index.vue')
  },
  {
    name: 'checkOrg',
    path: '/wisdomBuild/checkOrg',
    id: '433',
    meta: { id: '433' },
    component: () => import('@/views/checkOrg/index.vue')
  },
  {
    name: 'checkOrgForm',
    path: '/wisdomBuild/checkOrg/form',
    component: () => import('@/views/checkOrg/form.vue')
  },
  // {
  //   name: 'sork',
  //   id: '434',
  //   meta: { id: '434' },
  //   path: '/wisdomBuild/sork',
  //   component: () =>
  //     import('@/views/wisdomBuild/sork/index.vue')
  // },
  {
    name: 'notice',
    id: '435',
    meta: { id: '435' },
    path: '/wisdomBuild/notice',
    component: () =>
      import('@/views/wisdomBuild/notice/index.vue')
  },
  {
    name: 'disease',
    id: '436',
    meta: { id: '436' },
    path: '/wisdomBuild/disease',
    component: () =>
      import('@/views/wisdomBuild/disease/index.vue')
  }
]
// 智慧建设
const childrenFour = [
  // 项目看板
  {
    name: 'projectOverview',
    id: '451',
    meta: { id: '451' },
    path: '/wisdomConstruction/projectOverview',
    component: () =>
      import(
        '@/views/wisdomConstruction/projectOverview/index'
      )
  },
  // 建设项目信息管理
  {
    name: 'messageManagement',
    id: '452',
    meta: { id: '452' },
    path: '/wisdomConstruction/messageManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomConstruction/messageManagement/list',
    children: [
      {
        name: 'messageManagementList',
        path: '/wisdomConstruction/messageManagement/list',
        id: '4521',
        meta: { id: '4521' },
        component: () =>
          import(
            '@/views/wisdomConstruction/messageManagement/components/list'
          )
      },
      {
        name: 'messageManagementForm',
        path: '/wisdomConstruction/messageManagement/form',
        id: '4522',
        meta: { id: '4522' },
        component: () =>
          import(
            '@/views/wisdomConstruction/messageManagement/components/add.vue'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          isView: route.query.isView === 'true',
          isCheck: route.query.isCheck === 'true',
          title: route.query.title
        })
      }
    ]
  },
  // 项目档案管理
  {
    name: 'fileManagement',
    id: '453',
    meta: { id: '453' },
    path: '/wisdomConstruction/fileManagement/preliminaryProcedure',
    component: () =>
      import('@/components/layouts/contentLayout'),

    redirect:
      '/wisdomConstruction/fileManagement/preliminaryProcedure/list',
    children: [
      // 前期手续管理
      {
        name: 'preliminaryProcedureList',
        path: '/wisdomConstruction/fileManagement/preliminaryProcedure/list',
        id: '4531',
        meta: { id: '4531' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/preliminaryProcedure/list'
          )
      },
      // 前期手续新增
      {
        name: 'preliminaryProcedureForm',
        path: '/wisdomConstruction/fileManagement/preliminaryProcedure/form',
        id: '',
        meta: { id: '4531' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/component/formPage'
          )
      }
    ]
  },
  // 项目设计
  {
    name: 'projectDesign',
    id: '4532',
    meta: { id: '4532' },
    path: '/wisdomConstruction/fileManagement/projectDesign',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomConstruction/fileManagement/projectDesign/list',
    children: [
      {
        name: 'projectDesignList',
        path: '/wisdomConstruction/fileManagement/projectDesign/list',
        id: '',
        meta: { id: '4532' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/projectDesign/list'
          )
      },
      {
        name: 'projectDesignForm',
        path: '/wisdomConstruction/fileManagement/projectDesign/form',
        id: '',
        meta: { id: '4532' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/component/formPage'
          )
      }
    ]
  },
  // 项目招标
  {
    name: 'projectBidding',
    id: '',
    path: '/wisdomConstruction/fileManagement/projectBidding',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomConstruction/fileManagement/projectBidding/list',
    children: [
      {
        name: 'projectBiddingList',
        path: '/wisdomConstruction/fileManagement/projectBidding/list',
        id: '4534',
        meta: { id: '4534' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/projectBidding/list'
          )
      },
      {
        name: 'projectBiddingForm',
        path: '/wisdomConstruction/fileManagement/projectBidding/form',
        meta: { id: '4534' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/component/formPage'
          )
      }
    ]
  },
  // 项目实施
  {
    name: 'projectImply',
    id: '',
    path: '/wisdomConstruction/fileManagement/projectImply',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomConstruction/fileManagement/projectImply/list',
    children: [
      {
        name: 'projectImplyList',
        path: '/wisdomConstruction/fileManagement/projectImply/list',
        id: '4534',
        meta: { id: '4534' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/projectImply/list'
          )
      },
      {
        name: 'projectImplyForm',
        path: '/wisdomConstruction/fileManagement/projectImply/form',
        id: '',
        meta: { id: '4534' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/component/formPage'
          )
      }
    ]
  },
  // 项目结算、预算
  {
    name: 'projectSettlement',
    id: '',
    path: '/wisdomConstruction/fileManagement/projectSettlement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomConstruction/fileManagement/projectSettlement/list',
    children: [
      {
        name: 'projectSettlementList',
        path: '/wisdomConstruction/fileManagement/projectSettlement/list',
        id: '4535',
        meta: { id: '4535' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/projectSettlement/list'
          )
      },
      {
        name: 'projectSettlementForm',
        path: '/wisdomConstruction/fileManagement/projectSettlement/form',
        id: '',
        meta: { id: '4535' },
        component: () =>
          import(
            '@/views/wisdomConstruction/fileManagement/component/formPage'
          )
      }
    ]
  },
  {
    name: 'projectExport',
    id: '454',
    meta: { id: '454' },
    path: '/wisdomConstruction/projectExport',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomConstruction/projectExport/list',
    children: [
      {
        name: 'projectSettlementList',
        path: '/wisdomConstruction/projectExport/list',
        id: '454',
        meta: { id: '454' },
        component: () =>
          import(
            '@/views/wisdomConstruction/projectExport/index'
          )
      }
    ]
  },
  // 安全报告
  {
    name: 'reportManagement',
    id: '455',
    meta: { id: '455' },
    path: '/wisdomConstruction/reportManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomConstruction/reportManagement/list',
    children: [
      {
        name: 'reportManagementList',
        path: '/wisdomConstruction/reportManagement/list',
        meta: { id: '455' },
        component: () =>
          import(
            '@/views/wisdomConstruction/reportManagement/list'
          )
      },
      {
        name: 'reportManagementForm',
        path: '/wisdomConstruction/reportManagement/form',
        meta: { id: '455' },
        component: () =>
          import(
            '@/views/wisdomConstruction/reportManagement/form'
          ),
        props: (route) => ({
          projectId: route.query.projectId,
          pkid: route.query.pkid,
          dataStr: route.query.dataStr,
          type: route.query.type,
          title: route.query.title
        })
      }
    ]
  },
  {
    name: 'noticeManagement',
    id: '456',
    meta: { id: '456' },
    path: '/wisdomConstruction/noticeManagement',
    component: () =>
      import(
        '@/views/wisdomConstruction/noticeManagement/index'
      )
  },
  {
    name: 'epidemicManagement',
    id: '',
    path: '/wisdomConstruction/epidemicManagement',
    component: () =>
      import(
        '@/views/wisdomConstruction/epidemicManagement/index'
      )
  },
  // 项目生长树
  {
    name: 'projectGrowthTree',
    id: '4522',
    meta: { id: '4522' },
    path: '/wisdomConstruction/projectGrowthTree',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomConstruction/projectGrowthTree/list',
    children: [
      {
        name: 'projectGrowthTreeList',
        path: '/wisdomConstruction/projectGrowthTree/list',
        meta: { id: '4522' },
        component: () =>
          import(
            '@/views/wisdomConstruction/projectGrowthTree/list'
          )
      },
      {
        name: 'projectGrowthTreeDetail',
        path: '/wisdomConstruction/projectGrowthTree/detail',
        meta: { id: '4522' },
        component: () =>
          import(
            '@/views/wisdomConstruction/projectGrowthTree/detail'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          isView: route.query.isView === 'true',
          isCheck: route.query.isCheck === 'true',
          title: route.query.title
        })
      }
    ]
  },
  // 项目巡查管理
  {
    name: 'projectPatrolManagement',
    id: '459',
    meta: { id: '459' },
    path: '/wisdomConstruction/projectPatrolManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomConstruction/projectPatrolManagement/patrolProject',
    children: [
      {
        name: 'patrolProject',
        path: '/wisdomConstruction/projectPatrolManagement/patrolProject',
        id: '4591',
        meta: { id: '4591' },
        component: () =>
          import(
            '@/views/wisdomConstruction/projectPatrolManagement/patrolProject/index'
          ),
        redirect:
          '/wisdomConstruction/projectPatrolManagement/patrolProject/list',
        children: [
          {
            name: 'patrolProjectList',
            path: '/wisdomConstruction/projectPatrolManagement/patrolProject/list',
            meta: { id: '4591' },
            component: () =>
              import(
                '@/views/wisdomConstruction/projectPatrolManagement/patrolProject/list'
              )
          },
          {
            name: 'patrolProjectDetail',
            path: '/wisdomConstruction/projectPatrolManagement/patrolProject/detail',
            meta: { id: '4591' },
            component: () =>
              import(
                '@/views/wisdomConstruction/projectPatrolManagement/patrolProject/detail'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              projectId: route.query.projectId,
              projectBaseId: route.query.projectBaseId
            })
          }
        ]
      },
      {
        name: 'patrolRecord',
        path: '/wisdomConstruction/projectPatrolManagement/patrolRecord',
        id: '4592',
        meta: { id: '4592' },
        component: () =>
          import(
            '@/views/wisdomConstruction/projectPatrolManagement/patrolRecord/index'
          ),
        redirect:
          '/wisdomConstruction/projectPatrolManagement/patrolRecord/list',
        children: [
          {
            name: 'patrolRecordList',
            path: '/wisdomConstruction/projectPatrolManagement/patrolRecord/list',
            meta: { id: '4592' },
            component: () =>
              import(
                '@/views/wisdomConstruction/projectPatrolManagement/patrolRecord/list'
              )
          },
          {
            name: 'patrolRecordAdd',
            path: '/wisdomConstruction/projectPatrolManagement/patrolRecord/add',
            meta: { id: '4592' },
            component: () =>
              import(
                '@/views/wisdomConstruction/projectPatrolManagement/patrolRecord/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true',
              problemCount: route.query.problemCount
            })
          }
        ]
      }
    ]
  }
]
// 智慧科创
const childrenFive = [
  // 科创看板
  {
    name: 'innovationOverview',
    id: '461',
    meta: { id: '461' },
    path: '/wisdomInnovation/innovationOverview',
    component: () =>
      import(
        '@/views/wisdomInnovation/innovationOverview/index'
      )
  },
  // 专家管理
  {
    name: 'expertManagement',
    id: '462',
    meta: { id: '462' },
    path: '/wisdomInnovation/expertManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),

    redirect: '/wisdomInnovation/expertManagement/list',
    children: [
      {
        name: 'expertManagementList',
        path: '/wisdomInnovation/expertManagement/list',
        id: '',
        meta: { id: '462' },
        component: () =>
          import(
            '@/views/wisdomInnovation/expertManagement/components/list'
          )
      },
      {
        name: 'expertManagementForm',
        path: '/wisdomInnovation/expertManagement/form',
        id: '',
        meta: { id: '462' },
        component: () =>
          import(
            '@/views/wisdomInnovation/expertManagement/components/add.vue'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          isView: route.query.isView,
          isCheck: route.query.isCheck,
          title: route.query.title
        })
      }
    ]
  },
  // 项目管理
  {
    name: 'projectManagement',
    id: '463',
    meta: { id: '463' },
    path: '/wisdomInnovation/projectManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomInnovation/projectManagement/list',
    children: [
      {
        name: 'projectManagementList',
        path: '/wisdomInnovation/projectManagement/list',
        id: '',
        meta: { id: '463' },
        component: () =>
          import(
            '@/views/wisdomInnovation/projectManagement/components/list'
          )
      },
      {
        name: 'projectManagementForm',
        path: '/wisdomInnovation/projectManagement/add',
        id: '',
        meta: { id: '463' },
        component: () =>
          import(
            '@/views/wisdomInnovation/projectManagement/components/add.vue'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'projectManagementForm',
        path: '/wisdomInnovation/projectManagement/update',
        id: '',
        meta: { id: '463' },
        component: () =>
          import(
            '@/views/wisdomInnovation/projectManagement/components/update.vue'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title
        })
      }
    ]
  },
  // 合作事项管理
  {
    name: 'cooperationManagement',
    id: '464',
    meta: { id: '464' },
    path: '/wisdomInnovation/cooperationManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),

    redirect:
      '/wisdomInnovation/cooperationManagement/list',
    children: [
      {
        name: 'cooperationManagementList',
        path: '/wisdomInnovation/cooperationManagement/list',
        id: '',
        meta: { id: '464' },
        component: () =>
          import(
            '@/views/wisdomInnovation/cooperationManagement/components/list'
          )
      },
      {
        name: 'cooperationManagementForm',
        path: '/wisdomInnovation/cooperationManagement/form',
        id: '',
        meta: { id: '464' },
        component: () =>
          import(
            '@/views/wisdomInnovation/cooperationManagement/components/add.vue'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  }
]
// 智慧土地
const childrenSix = [
  // 土地看板
  {
    name: 'wisdomLandOverview',
    id: '4712',
    meta: { id: '4712' },
    path: '/wisdomLand/wisdomLandOverview',
    component: () =>
      import('@/views/wisdomLand/wisdomLandOverview/index')
  },
  // 土地一张图
  {
    name: 'LocationManagement',
    id: '472',
    meta: { id: '472' },
    path: '/wisdomLand/LocationManagement',
    component: () =>
      import('@/views/wisdomLand/LocationManagement/index')
    // redirect:
  },
  // 工地计划管理
  {
    name: 'SitePlanManagement',
    id: '473',
    meta: { id: '473' },
    path: '/wisdomLand/SitePlanManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomLand/SitePlanManagement/SiteProjectPlan',
    children: [
      // 供地计划管理
      {
        name: 'SiteProjectPlan',
        path: '/wisdomLand/SitePlanManagement/SiteProjectPlan',
        id: '473',
        meta: { id: '473' },
        component: () =>
          import(
            '@/views/wisdomLand/SitePlanManagement/SiteProjectPlan/index'
          ),
        redirect:
          '/wisdomLand/SitePlanManagement/SiteProjectPlan/list',
        children: [
          {
            name: 'SiteProjectPlanList',
            path: '/wisdomLand/SitePlanManagement/SiteProjectPlan/list',
            id: '',
            meta: { id: '473' },
            component: () =>
              import(
                '@/views/wisdomLand/SitePlanManagement/SiteProjectPlan/list'
              )
          },
          {
            name: 'SiteProjectPlanAdd',
            path: '/wisdomLand/SitePlanManagement/SiteProjectPlan/add',
            id: '',
            meta: { id: '473' },
            component: () =>
              import(
                '@/views/wisdomLand/SitePlanManagement/SiteProjectPlan/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 供地计划看板
      {
        name: 'SitePlanBoard',
        path: '/wisdomLand/SitePlanManagement/SitePlanBoard',
        id: '4711',
        meta: { id: '4711' },
        component: () =>
          import(
            '@/views/wisdomLand/SitePlanManagement/SitePlanBoard/index'
          )
      }
    ]
  },
  {
    name: 'SiteReportManagement',
    path: '/wisdomLand/SiteReportManagement',
    id: '',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomLand/SiteReportManagement/LandInformation',
    children: [
      {
        name: 'LandInformation',
        path: '/wisdomLand/SiteReportManagement/LandInformation',
        id: '474',
        meta: { id: '474' },
        component: () =>
          import(
            '@/views/wisdomLand/SiteReportManagement/LandInformation/index'
          ),
        redirect:
          '/wisdomLand/SiteReportManagement/LandInformation/list',
        children: [
          // 土地信息管理
          {
            name: 'LandInformationList',
            path: '/wisdomLand/SiteReportManagement/LandInformation/list',
            id: '4741',
            meta: { id: '4741' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/LandInformation/list'
              )
          },
          {
            name: 'LandInformationFormPage',
            path: '/wisdomLand/SiteReportManagement/LandInformation/formPage',
            id: '472',
            meta: { id: '472' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/components/formPage'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              type: route.query.type,
              defaultIndex: route.query.defaultIndex
            })
          }
        ]
      },
      // 勘界资料管理
      {
        name: 'kanjieData',
        id: '4742',
        meta: { id: '4742' },
        path: '/wisdomLand/SiteReportManagement/kanjieData',
        component: () =>
          import(
            '@/views/wisdomLand/SiteReportManagement/kanjieData/index'
          ),
        redirect:
          '/wisdomLand/SiteReportManagement/kanjieData/list',
        children: [
          {
            name: 'kanjieDataList',
            path: '/wisdomLand/SiteReportManagement/kanjieData/list',
            id: '',
            meta: { id: '4742' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/kanjieData/list'
              )
          },
          {
            name: 'kanjieDataFormPage',
            path: '/wisdomLand/SiteReportManagement/kanjieData/formPage',
            id: '',
            meta: { id: '4742' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/components/formPage'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              defaultIndex: route.query.defaultIndex,
              type: route.query.type
            })
          }
        ]
      },
      // 征前资料管理
      {
        name: 'ExamData',
        id: '4743',
        meta: { id: '4743' },
        path: '/wisdomLand/SiteReportManagement/ExamData',
        component: () =>
          import(
            '@/views/wisdomLand/SiteReportManagement/ExamData/index'
          ),
        redirect:
          '/wisdomLand/SiteReportManagement/ExamData/list',
        children: [
          {
            name: 'ExamDataList',
            path: '/wisdomLand/SiteReportManagement/ExamData/list',
            id: '',
            meta: { id: '4743' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/ExamData/list'
              )
          },
          {
            name: 'ExamDataFormPage',
            path: '/wisdomLand/SiteReportManagement/ExamData/formPage',
            id: '',
            meta: { id: '4743' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/components/formPage'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              defaultIndex: route.query.defaultIndex,
              type: route.query.type
            })
          }
        ]
      },
      // 组卷资料管理
      {
        name: 'collectionBefore',
        id: '4744',
        meta: { id: '4744' },
        path: '/wisdomLand/SiteReportManagement/collectionBefore',
        component: () =>
          import(
            '@/views/wisdomLand/SiteReportManagement/collectionBefore/index'
          ),
        redirect:
          '/wisdomLand/SiteReportManagement/collectionBefore/list',
        children: [
          {
            name: 'collectionBeforeList',
            path: '/wisdomLand/SiteReportManagement/collectionBefore/list',
            id: '4743',
            meta: { id: '4743' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/collectionBefore/list'
              )
          },
          {
            name: 'collectionBeforeFormPage',
            path: '/wisdomLand/SiteReportManagement/collectionBefore/formPage',
            id: '4743',
            meta: { id: '4743' },
            component: () =>
              import(
                '@/views/wisdomLand/SiteReportManagement/components/formPage'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              defaultIndex: route.query.defaultIndex,
              type: route.query.type
            })
          }
        ]
      }
    ]
  },
  // 管护资料管理
  {
    name: 'ManagementDataManagement',
    id: '476',
    meta: { id: '476' },
    path: '/wisdomLand/ManagementDataManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomLand/ManagementDataManagement/list',
    children: [
      {
        name: 'ManagementDataManagementList',
        path: '/wisdomLand/ManagementDataManagement/list',
        meta: { id: '476' },
        component: () =>
          import(
            '@/views/wisdomLand/ManagementDataManagement/list'
          )
      },
      {
        name: 'ManagementDataManagementAdd',
        path: '/wisdomLand/ManagementDataManagement/add',
        meta: { id: '476' },
        component: () =>
          import(
            '@/views/wisdomLand/ManagementDataManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  }
]
const childrenSeven = [
  // 规划看板
  {
    name: 'wisdomPlanningOverview',
    id: '481',
    meta: { id: '481' },
    path: '/wisdomPlanning/wisdomPlanningOverview',
    component: () =>
      import(
        '@/views/wisdomPlanning/wisdomPlanningOverview/index'
      )
  },
  // 项目选址
  {
    name: 'projectLocation',
    id: '482',
    meta: { id: '482' },
    path: '/wisdomPlanning/projectLocation',
    component: () =>
      import('@/views/wisdomPlanning/projectLocation/index')
    // redirect:
  },
  // 房建项目管理
  {
    name: 'housingProjectManagement',
    path: '/wisdomPlanning/housingProjectManagement',
    id: '483',
    meta: { id: '483' },
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomPlanning/housingProjectManagement/basicElementService'
  },
  // 房建项目管理-基础要素服务
  {
    name: 'basicElementService',
    path: '/wisdomPlanning/housingProjectManagement/basicElementService',
    id: '4831',
    meta: { id: '4831' },
    component: () =>
      import(
        '@/views/wisdomPlanning/housingProjectManagement/basicElementService/index'
      ),

    redirect:
      '/wisdomPlanning/housingProjectManagement/basicElementService/list',
    children: [
      {
        name: 'basicElementServiceList',
        path: '/wisdomPlanning/housingProjectManagement/basicElementService/list',
        id: '',
        meta: { id: '4831' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/basicElementService/list'
          )
      },
      {
        name: 'basicElementServiceFormPage',
        path: '/wisdomPlanning/housingProjectManagement/basicElementService/formPage',
        id: '',
        meta: { id: '4831' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 房建项目管理-工程建设许可
  {
    name: 'EngineeringConstructionPermit',
    id: '4834',
    meta: { id: '4834' },
    path: '/wisdomPlanning/housingProjectManagement/EngineeringConstructionPermit',
    component: () =>
      import(
        '@/views/wisdomPlanning/housingProjectManagement/EngineeringConstructionPermit/index'
      ),
    redirect:
      '/wisdomPlanning/housingProjectManagement/EngineeringConstructionPermit/list',
    children: [
      {
        name: 'EngineeringConstructionPermitList',
        path: '/wisdomPlanning/housingProjectManagement/EngineeringConstructionPermit/list',
        id: '',
        meta: { id: '4834' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/EngineeringConstructionPermit/list'
          )
      },
      {
        name: 'EngineeringConstructionPermitFormPage',
        path: '/wisdomPlanning/housingProjectManagement/EngineeringConstructionPermit/formPage',
        id: '',
        meta: { id: '4834' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 房建项目管理-建设工程规划核实
  {
    name: 'planningVerification',
    id: '4835',
    meta: { id: '4835' },
    path: '/wisdomPlanning/housingProjectManagement/planningVerification',
    component: () =>
      import(
        '@/views/wisdomPlanning/housingProjectManagement/planningVerification/index'
      ),
    redirect:
      '/wisdomPlanning/housingProjectManagement/planningVerification/list',
    children: [
      {
        name: 'planningVerificationList',
        path: '/wisdomPlanning/housingProjectManagement/planningVerification/list',
        id: '',
        meta: { id: '4835' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/planningVerification/list'
          )
      },
      {
        name: 'planningVerificationFormPage',
        path: '/wisdomPlanning/housingProjectManagement/planningVerification/formPage',
        id: '',
        meta: { id: '4835' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 房建项目管理-立项用地规划许可
  {
    name: 'ProjectApproval',
    id: '4833',
    meta: { id: '4833' },
    path: '/wisdomPlanning/housingProjectManagement/ProjectApproval',
    component: () =>
      import(
        '@/views/wisdomPlanning/housingProjectManagement/ProjectApproval/index'
      ),
    redirect:
      '/wisdomPlanning/housingProjectManagement/ProjectApproval/list',
    children: [
      {
        name: 'ProjectApprovalList',
        path: '/wisdomPlanning/housingProjectManagement/ProjectApproval/list',
        id: '',
        meta: { id: '4833' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/ProjectApproval/list'
          )
      },
      {
        name: 'ProjectApprovalFormPage',
        path: '/wisdomPlanning/housingProjectManagement/ProjectApproval/formPage',
        id: '',
        meta: { id: '4833' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 房建项目管理-项目生成
  {
    name: 'projectGeneration',
    id: '4832',
    meta: { id: '4832' },
    path: '/wisdomPlanning/housingProjectManagement/projectGeneration',
    component: () =>
      import(
        '@/views/wisdomPlanning/housingProjectManagement/projectGeneration/index'
      ),
    redirect:
      '/wisdomPlanning/housingProjectManagement/projectGeneration/list',
    children: [
      {
        name: 'projectGenerationList',
        path: '/wisdomPlanning/housingProjectManagement/projectGeneration/list',
        id: '',
        meta: { id: '4832' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/projectGeneration/list'
          )
      },
      {
        name: 'projectGenerationFormPage',
        path: '/wisdomPlanning/housingProjectManagement/projectGeneration/formPage',
        id: '',
        meta: { id: '4832' },
        component: () =>
          import(
            '@/views/wisdomPlanning/housingProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 市政项目管理
  {
    name: 'MunicipalProjectManagement',
    path: '/wisdomPlanning/MunicipalProjectManagement',
    id: '471',
    meta: { id: '471' },
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomPlanning/MunicipalProjectManagement/complianceReview'
  },
  // 市政项目管理-合规性审查
  {
    name: 'complianceReview',
    path: '/wisdomPlanning/MunicipalProjectManagement/complianceReview',
    id: '4841',
    meta: { id: '4841' },
    component: () =>
      import(
        '@/views/wisdomPlanning/MunicipalProjectManagement/complianceReview/index'
      ),

    redirect:
      '/wisdomPlanning/MunicipalProjectManagement/complianceReview/list',
    children: [
      {
        name: 'complianceReviewList',
        path: '/wisdomPlanning/MunicipalProjectManagement/complianceReview/list',
        id: '',
        meta: { id: '4841' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/complianceReview/list'
          )
      },
      {
        name: 'complianceReviewFormPage',
        path: '/wisdomPlanning/MunicipalProjectManagement/complianceReview/formPage',
        id: '',
        meta: { id: '4841' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 市政项目管理-立项生成
  {
    name: 'lixiangshengcheng',
    id: '4842',
    meta: { id: '4842' },
    path: '/wisdomPlanning/MunicipalProjectManagement/lixiangshengcheng',
    component: () =>
      import(
        '@/views/wisdomPlanning/MunicipalProjectManagement/lixiangshengcheng/index'
      ),
    redirect:
      '/wisdomPlanning/MunicipalProjectManagement/lixiangshengcheng/list',
    children: [
      {
        name: 'lixiangshengchengList',
        path: '/wisdomPlanning/MunicipalProjectManagement/lixiangshengcheng/list',
        id: '',
        meta: { id: '4842' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/lixiangshengcheng/list'
          )
      },
      {
        name: 'lixiangshengchengFormPage',
        path: '/wisdomPlanning/MunicipalProjectManagement/lixiangshengcheng/formPage',
        id: '',
        meta: { id: '4842' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 市政项目管理-工程建设规划许可
  {
    name: 'gcjsghxk',
    id: '4844',
    meta: { id: '4844' },
    path: '/wisdomPlanning/MunicipalProjectManagement/gcjsghxk',
    component: () =>
      import(
        '@/views/wisdomPlanning/MunicipalProjectManagement/gcjsghxk/index'
      ),
    redirect:
      '/wisdomPlanning/MunicipalProjectManagement/gcjsghxk/list',
    children: [
      {
        name: 'gcjsghxkList',
        path: '/wisdomPlanning/MunicipalProjectManagement/gcjsghxk/list',
        id: '',
        meta: { id: '4844' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/gcjsghxk/list'
          )
      },
      {
        name: 'gcjsghxkFormPage',
        path: '/wisdomPlanning/MunicipalProjectManagement/gcjsghxk/formPage',
        id: '',
        meta: { id: '4844' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 市政项目管理-建设工程规划核实
  {
    name: 'jsgcghhs',
    id: '4845',
    meta: { id: '4845' },
    path: '/wisdomPlanning/MunicipalProjectManagement/jsgcghhs',
    component: () =>
      import(
        '@/views/wisdomPlanning/MunicipalProjectManagement/jsgcghhs/index'
      ),
    redirect:
      '/wisdomPlanning/MunicipalProjectManagement/jsgcghhs/list',
    children: [
      {
        name: 'jsgcghhsList',
        path: '/wisdomPlanning/MunicipalProjectManagement/jsgcghhs/list',
        id: '',
        meta: { id: '4845' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/jsgcghhs/list'
          )
      },
      {
        name: 'jsgcghhsFormPage',
        path: '/wisdomPlanning/MunicipalProjectManagement/jsgcghhs/formPage',
        id: '',
        meta: { id: '4845' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 市政项目管理-用地规划许可
  {
    name: 'useLandLicense',
    id: '4843',
    meta: { id: '4843' },
    path: '/wisdomPlanning/MunicipalProjectManagement/useLandLicense',
    component: () =>
      import(
        '@/views/wisdomPlanning/MunicipalProjectManagement/useLandLicense/index'
      ),
    redirect:
      '/wisdomPlanning/MunicipalProjectManagement/useLandLicense/list',
    children: [
      {
        name: 'useLandLicenseList',
        path: '/wisdomPlanning/MunicipalProjectManagement/useLandLicense/list',
        id: '',
        meta: { id: '4843' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/useLandLicense/list'
          )
      },
      {
        name: 'useLandLicenseFormPage',
        path: '/wisdomPlanning/MunicipalProjectManagement/useLandLicense/formPage',
        id: '',
        meta: { id: '4843' },
        component: () =>
          import(
            '@/views/wisdomPlanning/MunicipalProjectManagement/components/formPage'
          )
      }
    ]
  },
  // 规划竖向管理
  {
    name: 'PlanningVerticalManagement',
    id: '485',
    meta: { id: '485' },
    path: '/wisdomPlanning/PlanningVerticalManagement',
    component: () =>
      import(
        '@/views/wisdomPlanning/PlanningVerticalManagement/index'
      )
  },
  // 辅助决策
  {
    name: 'DecisionSupport',
    id: '486',
    meta: { id: '486' },
    path: '/wisdomPlanning/DecisionSupport',
    component:
      // import('@/views/wisdomPlanning/DecisionSupport/index')
      () => import('@/views/decision/index.vue')
  }
]
const childrenEight = [
  {
    name: 'wisdomOperationOverview',
    id: '4A1',
    meta: { id: '4A1' },
    path: '/wisdomOperation/wisdomOperationOverview',
    component: () =>
      import(
        '@/views/wisdomOperation/wisdomOperationOverview/index'
      )
  },
  {
    name: 'buildingManagement',
    id: '4A2',
    meta: { id: '4A2' },
    path: '/wisdomOperation/buildingManagement',
    component: () =>
      import(
        '@/views/wisdomOperation/buildingManagement/index'
      ),
    redirect: '/wisdomOperation/buildingManagement/list',
    children: [
      {
        name: 'buildingManagementList',
        path: '/wisdomOperation/buildingManagement/list',
        meta: { id: '4A2' },
        component: () =>
          import(
            '@/views/wisdomOperation/buildingManagement/list'
          )
      },
      {
        name: 'buildingManagementFormPage',
        path: '/wisdomOperation/buildingManagement/formPage',
        meta: { id: '4A2' },
        component: () =>
          import(
            '@/views/wisdomOperation/buildingManagement/add'
          )
      }
    ]
  },
  {
    name: 'ParkManagement',
    id: '4A3',
    meta: { id: '4A3' },
    path: '/wisdomOperation/ParkManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomOperation/ParkManagement/list',
    children: [
      {
        name: 'ParkManagementList',
        path: '/wisdomOperation/ParkManagement/list',
        meta: { id: '4A3' },
        component: () =>
          import(
            '@/views/wisdomOperation/ParkManagement/list'
          )
      },
      {
        name: 'ParkManagementAdd',
        path: '/wisdomOperation/ParkManagement/add',
        meta: { id: '4A3' },
        component: () =>
          import(
            '@/views/wisdomOperation/ParkManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  }
]
// 智慧产业
const childNight = [
  // 产业看板
  {
    name: 'wisdomIndustryOverview',
    id: '491',
    meta: { id: '491' },
    path: '/wisdomIndustry/WisdomIndustryOverview',
    component: () =>
      import(
        '@/views/wisdomIndustry/WisdomIndustryOverview/index'
      )
  },
  // 产业信息管理
  {
    name: 'wisdomIndustryIndustryInfoManagement',
    id: '492',
    meta: { id: '492' },
    path: '/wisdomIndustry/IndustryInfoManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics',
    children: [
      // 消费电子
      {
        name: 'ConsumerElectronics',
        path: '/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics',
        id: '4921',
        meta: { id: '4921' },
        component: () =>
          import(
            '@/views/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics/index'
          ),
        redirect:
          '/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics/list',
        children: [
          {
            name: 'ConsumerElectronicsList',
            path: '/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics/list',
            meta: { id: '4921' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics/list'
              )
          },
          {
            name: 'ConsumerElectronicsAdd',
            path: '/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics/add',
            meta: { id: '4921' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/ConsumerElectronics/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 智能网联汽车
      {
        name: 'IntelligentConnectedVehicle',
        path: '/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle',
        id: '4922',
        meta: { id: '4922' },
        component: () =>
          import(
            '@/views/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle/index'
          ),
        redirect:
          '/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle/list',
        children: [
          {
            name: 'IntelligentConnectedVehicleList',
            path: '/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle/list',
            meta: { id: '4922' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle/list'
              )
          },
          {
            name: 'IntelligentConnectedVehicleAdd',
            path: '/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle/add',
            meta: { id: '4922' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/IntelligentConnectedVehicle/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 航空航天
      {
        name: 'Aerospace',
        path: '/wisdomIndustry/IndustryInfoManagement/Aerospace',
        id: '4923',
        meta: { id: '4923' },
        component: () =>
          import(
            '@/views/wisdomIndustry/IndustryInfoManagement/Aerospace/index'
          ),
        redirect:
          '/wisdomIndustry/IndustryInfoManagement/Aerospace/list',
        children: [
          {
            name: 'AerospaceList',
            path: '/wisdomIndustry/IndustryInfoManagement/Aerospace/list',
            meta: { id: '4923' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/Aerospace/list'
              )
          },
          {
            name: 'AerospaceAdd',
            path: '/wisdomIndustry/IndustryInfoManagement/Aerospace/add',
            meta: { id: '4923' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/Aerospace/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 精密仪器制造
      {
        name: 'PrecisionApparatus',
        path: '/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus',
        id: '4924',
        meta: { id: '4924' },
        component: () =>
          import(
            '@/views/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus/index'
          ),
        redirect:
          '/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus/list',
        children: [
          {
            name: 'PrecisionApparatusList',
            path: '/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus/list',
            meta: { id: '4924' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus/list'
              )
          },
          {
            name: 'PrecisionApparatusAdd',
            path: '/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus/add',
            meta: { id: '4924' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/PrecisionApparatus/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 人工智能机器人
      {
        name: 'ArtificiallyIntelligent',
        path: '/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent',
        id: '4925',
        meta: { id: '4925' },
        component: () =>
          import(
            '@/views/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent/index'
          ),
        redirect:
          '/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent/list',
        children: [
          {
            name: 'ArtificiallyIntelligentList',
            path: '/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent/list',
            meta: { id: '4925' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent/list'
              )
          },
          {
            name: 'ArtificiallyIntelligentAdd',
            path: '/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent/add',
            meta: { id: '4925' },
            component: () =>
              import(
                '@/views/wisdomIndustry/IndustryInfoManagement/ArtificiallyIntelligent/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      }
    ]
  },
  // 企业信息管理
  {
    name: 'wisdomIndustryEnterpriseInfoManagement',
    id: '493',
    meta: { id: '493' },
    path: '/wisdomIndustry/EnterpriseInfoManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation',
    children: [
      // 市场主体培育管理
      {
        name: 'MarketSubjectCultivation',
        path: '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation',
        id: '4931',
        meta: { id: '4931' },
        component: () =>
          import(
            '@/views/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation/index'
          ),
        redirect:
          '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation/list',
        children: [
          {
            name: 'MarketSubjectCultivationList',
            path: '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation/list',
            meta: { id: '4931' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation/list'
              )
          },
          {
            name: 'MarketSubjectCultivationAdd',
            path: '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation/add',
            meta: { id: '4931' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectCultivation/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 仅注册企业管理
      {
        name: 'MarketSubjectRegistration',
        path: '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration',
        id: '4932',
        meta: { id: '4932' },
        component: () =>
          import(
            '@/views/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration/index'
          ),
        redirect:
          '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration/list',
        children: [
          {
            name: 'MarketSubjectRegistrationList',
            path: '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration/list',
            meta: { id: '4932' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration/list'
              )
          },
          {
            name: 'MarketSubjectRegistrationAdd',
            path: '/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration/add',
            meta: { id: '4932' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/MarketSubjectRegistration/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 租赁场地企业管理
      {
        name: 'LeasingVenueEnterprises',
        path: '/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises',
        id: '4933',
        meta: { id: '4933' },
        component: () =>
          import(
            '@/views/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises/index'
          ),
        redirect:
          '/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises/list',
        children: [
          {
            name: 'LeasingVenueEnterprisesList',
            path: '/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises/list',
            meta: { id: '4933' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises/list'
              )
          },
          {
            name: 'LeasingVenueEnterprisesAdd',
            path: '/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises/add',
            meta: { id: '4933' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/LeasingVenueEnterprises/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      },
      // 自建场地企业管理
      {
        name: 'SelfBuiltSiteEnterprise',
        path: '/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise',
        id: '4934',
        meta: { id: '4934' },
        component: () =>
          import(
            '@/views/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise/index'
          ),
        redirect:
          '/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise/list',
        children: [
          {
            name: 'SelfBuiltSiteEnterpriseList',
            path: '/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise/list',
            meta: { id: '4934' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise/list'
              )
          },
          {
            name: 'SelfBuiltSiteEnterpriseAdd',
            path: '/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise/add',
            meta: { id: '4934' },
            component: () =>
              import(
                '@/views/wisdomIndustry/EnterpriseInfoManagement/SelfBuiltSiteEnterprise/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          }
        ]
      }
    ]
  },
  // 区重点项目管理
  {
    name: 'wisdomIndustryKeyProjectManagement',
    id: '494',
    meta: { id: '494' },
    path: '/wisdomIndustry/KeyProjectManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomIndustry/KeyProjectManagement/list',
    children: [
      {
        name: 'wisdomIndustryKeyProjectManagementList',
        path: '/wisdomIndustry/KeyProjectManagement/list',
        meta: { id: '494' },
        component: () =>
          import(
            '@/views/wisdomIndustry/KeyProjectManagement/list'
          )
      },
      {
        name: 'wisdomIndustryKeyProjectManagementAdd',
        path: '/wisdomIndustry/KeyProjectManagement/add',
        meta: { id: '494' },
        component: () =>
          import(
            '@/views/wisdomIndustry/KeyProjectManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  // 政策计算器
  {
    name: 'wisdomIndustryPolicyCalculator',
    id: '495',
    meta: { id: '495' },
    path: '/wisdomIndustry/PolicyCalculator',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/wisdomIndustry/PolicyCalculator/PolicyManage',
    children: [
      // 政策管理
      {
        name: 'PolicyManage',
        path: '/wisdomIndustry/PolicyCalculator/PolicyManage',
        id: '4951',
        meta: { id: '4951' },
        component: () =>
          import(
            '@/views/wisdomIndustry/PolicyCalculator/PolicyManage/index'
          ),
        redirect:
          '/wisdomIndustry/PolicyCalculator/PolicyManage/list',
        children: [
          {
            name: 'PolicyManageList',
            path: '/wisdomIndustry/PolicyCalculator/PolicyManage/list',
            meta: { id: '4951' },
            component: () =>
              import(
                '@/views/wisdomIndustry/PolicyCalculator/PolicyManage/list'
              )
          },
          {
            name: 'PolicyManageAdd',
            path: '/wisdomIndustry/PolicyCalculator/PolicyManage/add',
            meta: { id: '4951' },
            component: () =>
              import(
                '@/views/wisdomIndustry/PolicyCalculator/PolicyManage/add'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title,
              isEdit: route.query.isEdit === 'true',
              isDetail: route.query.isDetail === 'true'
            })
          },
          {
            name: 'PolicyManageDetail',
            path: '/wisdomIndustry/PolicyCalculator/PolicyManage/detail',
            meta: { id: '4951' },
            component: () =>
              import(
                '@/views/wisdomIndustry/PolicyCalculator/PolicyManage/detail'
              ),
            props: (route) => ({
              pkid: route.query.pkid,
              title: route.query.title
            })
          }
        ]
      },
      // 政策匹配
      {
        name: 'PolicyMate',
        path: '/wisdomIndustry/PolicyCalculator/PolicyMate',
        id: '4952',
        meta: { id: '4952' },
        component: () =>
          import(
            '@/views/wisdomIndustry/PolicyCalculator/PolicyMate/index'
          ),
        redirect:
          '/wisdomIndustry/PolicyCalculator/PolicyMate/list',
        children: [
          {
            name: 'PolicyMateList',
            path: '/wisdomIndustry/PolicyCalculator/PolicyMate/list',
            meta: { id: '4952' },
            component: () =>
              import(
                '@/views/wisdomIndustry/PolicyCalculator/PolicyMate/list'
              )
          }
        ]
      }
    ]
  },
  // 固投目标作战图
  {
    name: 'FixedInvestmentTarget',
    id: '496',
    meta: { id: '496' },
    path: '/wisdomIndustry/FixedInvestmentTarget',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/wisdomIndustry/FixedInvestmentTarget/list',
    children: [
      {
        name: 'FixedInvestmentTargetList',
        path: '/wisdomIndustry/FixedInvestmentTarget/list',
        meta: { id: '496' },
        component: () =>
          import(
            '@/views/wisdomIndustry/FixedInvestmentTarget/list'
          )
      },
      {
        name: 'FixedInvestmentTargetAdd',
        path: '/wisdomIndustry/FixedInvestmentTarget/add',
        meta: { id: '496' },
        component: () =>
          import(
            '@/views/wisdomIndustry/FixedInvestmentTarget/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  }
]

// 数据管理
const childrenTen = [
  // 项目管理
  {
    name: 'investProjectInfo',
    id: '4B11',
    meta: { id: '4B11' },
    path: '/dataManagement/projectManagement/investProjectInfo',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/projectManagement/investProjectInfo/list',
    children: [
      {
        name: 'dataManagementProjectManagementInvestProjectInfoList',
        path: '/dataManagement/projectManagement/investProjectInfo/list',
        meta: { id: '4B11' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/investProjectInfo/list'
          )
      },
      {
        name: 'dataManagementProjectManagementInvestProjectInfoAdd',
        path: '/dataManagement/projectManagement/investProjectInfo/add',
        meta: { id: '4B11' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/investProjectInfo/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'construct',
    id: '4B12',
    meta: { id: '4B12' },
    path: '/dataManagement/projectManagement/constructProjectInfo',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/projectManagement/constructProjectInfo/list',
    children: [
      {
        name: 'dataManagementProjectManagementConstructProjectInfoList',
        path: '/dataManagement/projectManagement/constructProjectInfo/list',
        meta: { id: '4B12' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/constructProjectInfo/list'
          )
      },
      {
        name: 'dataManagementProjectManagementConstructProjectInfoAdd',
        path: '/dataManagement/projectManagement/constructProjectInfo/add',
        meta: { id: '4B12' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/constructProjectInfo/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'sectionManagement',
    id: '4B13',
    meta: { id: '4B13' },
    path: '/dataManagement/projectManagement/sectionManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/projectManagement/sectionManagement/list',
    children: [
      {
        name: 'dataManagementProjectManagementSectionManagementList',
        path: '/dataManagement/projectManagement/sectionManagement/list',
        meta: { id: '4B13' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/sectionManagement/list'
          )
      },
      {
        name: 'dataManagementProjectManagementSectionManagementAdd',
        path: '/dataManagement/projectManagement/sectionManagement/add',
        meta: { id: '4B13' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/sectionManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          projectId: route.query.projectId,
          type: route.query.type,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'dataManagementProjectManagementSectionManagementDetail',
        path: '/dataManagement/projectManagement/sectionManagement/detail',
        meta: { id: '4B13' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/sectionManagement/detail'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          projectId: route.query.projectId,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'fixed',
    id: '4B14',
    meta: { id: '4B14' },
    path: '/dataManagement/projectManagement/fixedTargetMap',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/projectManagement/fixedTargetMap/add',
    children: [
      {
        name: 'dataManagementProjectManagementFixedTargetMapList',
        path: '/dataManagement/projectManagement/fixedTargetMap/list',
        meta: { id: '4B14' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/fixedTargetMap/list'
          )
      },
      {
        name: 'dataManagementProjectManagementFixedTargetMapAdd',
        path: '/dataManagement/projectManagement/fixedTargetMap/add',
        meta: { id: '4B14' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/fixedTargetMap/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'investYearPlan',
    id: '4B15',
    meta: { id: '4B15' },
    path: '/dataManagement/projectManagement/investYearPlan',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/projectManagement/investYearPlan/list',
    children: [
      {
        name: 'dataManagementProjectManagementInvestYearPlanList',
        path: '/dataManagement/projectManagement/investYearPlan/list',
        meta: { id: '4B15' },
        component: () =>
          import(
            '@/views/dataManagement/projectManagement/investYearPlan/list'
          )
      }
    ]
  },
  {
    name: 'landExpropriation',
    id: '4B21',
    meta: { id: '4B21' },
    path: '/dataManagement/landManagement/landExpropriation',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/landManagement/landExpropriation/list',
    children: [
      {
        name: 'dataManagementLandManagementLandExpropriationList',
        path: '/dataManagement/landManagement/landExpropriation/list',
        meta: { id: '4B21' },
        component: () =>
          import(
            '@/views/dataManagement/landManagement/landExpropriation/list'
          )
      },
      {
        name: 'dataManagementLandManagementLandExpropriationAdd',
        path: '/dataManagement/landManagement/landExpropriation/add',
        meta: { id: '4B21' },
        component: () =>
          import(
            '@/views/dataManagement/landManagement/landExpropriation/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'landSupply',
    id: '4B22',
    meta: { id: '4B22' },
    path: '/dataManagement/landManagement/landSupply',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/landManagement/landSupply/list',
    children: [
      {
        name: 'dataManagementLandManagementLandSupplyList',
        path: '/dataManagement/landManagement/landSupply/list',
        meta: { id: '4B22' },
        component: () =>
          import(
            '@/views/dataManagement/landManagement/landSupply/list'
          )
      },
      {
        name: 'dataManagementLandManagementLandSupplyAdd',
        path: '/dataManagement/landManagement/landSupply/add',
        meta: { id: '4B22' },
        component: () =>
          import(
            '@/views/dataManagement/landManagement/landSupply/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'landDemolition',
    id: '4B23',
    meta: { id: '4B23' },
    path: '/dataManagement/landManagement/landDemolition',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/landManagement/landDemolition/list',
    children: [
      {
        name: 'dataManagementLandManagementLandDemolitionList',
        path: '/dataManagement/landManagement/landDemolition/list',
        meta: { id: '4B23' },
        component: () =>
          import(
            '@/views/dataManagement/landManagement/landDemolition/list'
          )
      },
      {
        name: 'dataManagementLandManagementlandDemolitionAdd',
        path: '/dataManagement/landManagement/landDemolition/add',
        meta: { id: '4B23' },
        component: () =>
          import(
            '@/views/dataManagement/landManagement/landDemolition/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'scientificInstitutions',
    id: '4B31',
    meta: { id: '4B31' },
    path: '/dataManagement/technologyManagement/scientificInstitutions',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/scientificInstitutions/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementScientificInstitutionsList',
        path: '/dataManagement/technologyManagement/scientificInstitutions/list',
        meta: { id: '4B31' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/scientificInstitutions/list'
          )
      },
      {
        name: 'dataManagementTechnologyManagementScientificInstitutionsAdd',
        path: '/dataManagement/technologyManagement/scientificInstitutions/add',
        meta: { id: '4B31' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/scientificInstitutions/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'incubateEnterprises',
    id: '4B32',
    meta: { id: '4B32' },
    path: '/dataManagement/technologyManagement/incubateEnterprises',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/incubateEnterprises/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementIncubateEnterprisesList',
        path: '/dataManagement/technologyManagement/incubateEnterprises/list',
        meta: { id: '4B32' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/incubateEnterprises/list'
          )
      },
      {
        name: 'dataManagementTechnologyManagementIncubateEnterprisesAdd',
        path: '/dataManagement/technologyManagement/incubateEnterprises/add',
        meta: { id: '4B32' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/incubateEnterprises/add'
          )
      }
    ]
  },
  {
    name: 'centerPlatform',
    id: '4B33',
    meta: { id: '4B33' },
    path: '/dataManagement/technologyManagement/centerPlatform',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/centerPlatform/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementcenterPlatformList',
        path: '/dataManagement/technologyManagement/centerPlatform/list',
        meta: { id: '4B33' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/centerPlatform/list'
          )
      },
      {
        name: 'dataManagementTechnologyManagementCenterPlatformAdd',
        path: '/dataManagement/technologyManagement/centerPlatform/add',
        meta: { id: '4B33' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/centerPlatform/add'
          )
      }
    ]
  },
  {
    name: 'civilAviationZone',
    id: '4B34',
    meta: { id: '4B34' },
    path: '/dataManagement/technologyManagement/civilAviationZone',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/civilAviationZone/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementCivilAviationZoneList',
        path: '/dataManagement/technologyManagement/civilAviationZone/list',
        meta: { id: '4B34' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/civilAviationZone/list'
          )
      }
    ]
  },
  {
    name: 'gatherTalents',
    id: '4B35',
    meta: { id: '4B35' },
    path: '/dataManagement/technologyManagement/gatherTalents',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/gatherTalents/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementGatherTalentsList',
        path: '/dataManagement/technologyManagement/gatherTalents/list',
        meta: { id: '4B35' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/gatherTalents/list'
          )
      }
    ]
  },
  {
    name: 'laboratoryManagement',
    id: '4B36',
    meta: { id: '4B36' },
    path: '/dataManagement/technologyManagement/laboratoryManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/laboratoryManagement/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementLaboratoryManagementList',
        path: '/dataManagement/technologyManagement/laboratoryManagement/list',
        meta: { id: '4B36' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/laboratoryManagement/list'
          )
      },
      {
        name: 'dataManagementTechnologyManagementLaboratoryManagementAdd',
        path: '/dataManagement/technologyManagement/laboratoryManagement/add',
        meta: { id: '4B36' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/laboratoryManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          options: route.query.options,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'universityCollaboration',
    id: '4B37',
    meta: { id: '4B37' },
    path: '/dataManagement/technologyManagement/universityCollaboration',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/technologyManagement/universityCollaboration/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementUniversityCollaborationList',
        path: '/dataManagement/technologyManagement/universityCollaboration/list',
        meta: { id: '4B37' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/universityCollaboration/list'
          )
      },
      {
        name: 'dataManagementTechnologyManagementUniversityCollaborationAdd',
        path: '/dataManagement/technologyManagement/universityCollaboration/add',
        meta: { id: '4B37' },
        component: () =>
          import(
            '@/views/dataManagement/technologyManagement/universityCollaboration/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'enterpriseEconomic',
    path: '/dataManagement/enterpriseManagement/enterpriseEconomic',
    id: '4B4',
    meta: { id: '4B4' },
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/enterpriseManagement/enterpriseEconomic/list',
    children: [
      {
        name: 'dataManagementEnterpriseEconomicList',
        path: '/dataManagement/enterpriseManagement/enterpriseEconomic/list',
        meta: { id: '4B4' },
        component: () =>
          import(
            '@/views/dataManagement/enterpriseManagement/enterpriseEconomic/list'
          )
      },
      {
        name: 'dataManagementEnterpriseEconomicAdd',
        path: '/dataManagement/enterpriseManagement/enterpriseEconomic/add',
        meta: { id: '4B4' },
        component: () =>
          import(
            '@/views/dataManagement/enterpriseManagement/enterpriseEconomic/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true',
          year: route.query.year,
          month: route.query.month
        })
      }
    ]
  },
  {
    name: 'enterpriseInfo',
    path: '/dataManagement/enterpriseManagement/enterpriseInfo',
    id: '4B40',
    meta: { id: '4B40' },
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/enterpriseManagement/enterpriseInfo/list',
    children: [
      {
        name: 'dataManagementEnterpriseInfoList',
        path: '/dataManagement/enterpriseManagement/enterpriseInfo/list',
        meta: { id: '4B40' },
        component: () =>
          import(
            '@/views/dataManagement/enterpriseManagement/enterpriseInfo/list'
          )
      },
      {
        name: 'dataManagementEnterpriseInfoAdd',
        path: '/dataManagement/enterpriseManagement/enterpriseInfo/add',
        meta: { id: '4B40' },
        component: () =>
          import(
            '@/views/dataManagement/enterpriseManagement/enterpriseInfo/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'foreignInvestment',
    id: '4B41',
    meta: { id: '4B41' },
    path: '/dataManagement/enterpriseManagement/foreignInvestment',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/enterpriseManagement/foreignInvestment/list',
    children: [
      {
        name: 'dataManagementEnterpriseManagementForeignInvestmentList',
        path: '/dataManagement/enterpriseManagement/foreignInvestment/list',
        meta: { id: '4B41' },
        component: () =>
          import(
            '@/views/dataManagement/enterpriseManagement/foreignInvestment/list'
          )
      }
    ]
  },
  {
    name: 'importantGoal',
    path: '/dataManagement/importantGoal',
    id: '4B5',
    meta: { id: '4B5' },
    component: () =>
      import('@/views/dataManagement/importantGoal/index')
  },
  {
    name: 'importantEvent',
    path: '/dataManagement/importantEvent',
    id: '4B6',
    meta: { id: '4B6' },
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/dataManagement/importantEvent/list',
    children: [
      {
        name: 'dataManagementimportantEventlist',
        path: '/dataManagement/importantEvent/list',
        meta: { id: '4B14' },
        component: () =>
          import(
            '@/views/dataManagement/importantEvent/list'
          )
      },
      {
        name: 'dataManagementimportantEventadd',
        path: '/dataManagement/importantEvent/add',
        meta: { id: '4B14' },
        component: () =>
          import(
            '@/views/dataManagement/importantEvent/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'leaderApprove',
    id: '4B7',
    meta: { id: '4B7' },
    path: '/dataManagement/leaderApprove',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/dataManagement/leaderApprove/list',
    children: [
      {
        name: 'dataManagementTechnologyManagementLeaderApproveList',
        path: '/dataManagement/leaderApprove/list',
        meta: { id: '4B7' },
        component: () =>
          import(
            '@/views/dataManagement/leaderApprove/list'
          )
      }
    ]
  },
  {
    name: 'parkManagement',
    id: '4B81',
    meta: { id: '4B81' },
    path: '/dataManagement/carrierReduction/parkManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/carrierReduction/parkManagement/list',
    children: [
      {
        name: 'dataManagementCarrierReductionParkManagementList',
        path: '/dataManagement/carrierReduction/parkManagement/list',
        meta: { id: '4B81' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/parkManagement/list'
          )
      },
      {
        name: 'dataManagementCarrierReductionParkManagementAdd',
        path: '/dataManagement/carrierReduction/parkManagement/add',
        meta: { id: '4B81' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/parkManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'dataManagementCarrierReductionParkManagementProcess',
        path: '/dataManagement/carrierReduction/parkManagement/process',
        meta: { id: '4B81' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/parkManagement/process'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'industrialCarrier',
    id: '4B82',
    meta: { id: '4B82' },
    path: '/dataManagement/carrierReduction/industrialCarrier',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/carrierReduction/industrialCarrier/list',
    children: [
      {
        name: 'dataManagementCarrierIndustrialCarrierList',
        path: '/dataManagement/carrierReduction/industrialCarrier/list',
        meta: { id: '4B82' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/industrialCarrier/list'
          )
      },
      {
        name: 'dataManagementCarrierIndustrialCarrierAdd',
        path: '/dataManagement/carrierReduction/industrialCarrier/add',
        meta: { id: '4B82' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/industrialCarrier/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'dataManagementCarrierReductionindustrialCarrierProcess',
        path: '/dataManagement/carrierReduction/industrialCarrier/process',
        meta: { id: '4B82' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/industrialCarrier/process'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'dataManagementCarrierReductionindustrialCarrierDetail',
        path: '/dataManagement/carrierReduction/industrialCarrier/detail',
        meta: { id: '4B82' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/industrialCarrier/detail'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          name: route.query.name,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'commercialVehicle',
    id: '4B83',
    meta: { id: '4B83' },
    path: '/dataManagement/carrierReduction/commercialVehicle',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/carrierReduction/commercialVehicle/list',
    children: [
      {
        name: 'dataManagementCarrierCommercialVehicleList',
        path: '/dataManagement/carrierReduction/commercialVehicle/list',
        meta: { id: '4B83' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/commercialVehicle/list'
          )
      },
      {
        name: 'dataManagementCarrierCommercialVehicleAdd',
        path: '/dataManagement/carrierReduction/commercialVehicle/add',
        meta: { id: '4B83' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/commercialVehicle/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'dataManagementCarrierCommercialVehicleProcess',
        path: '/dataManagement/carrierReduction/commercialVehicle/process',
        meta: { id: '4B83' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/commercialVehicle/process'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      },
      {
        name: 'dataManagementCommercialVehicleDetail',
        path: '/dataManagement/carrierReduction/commercialVehicle/detail',
        meta: { id: '4B83' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/commercialVehicle/detail'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          name: route.query.name,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'commercialHouse',
    id: '4B84',
    meta: { id: '4B84' },
    path: '/dataManagement/carrierReduction/commercialHouse',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect:
      '/dataManagement/carrierReduction/commercialHouse/list',
    children: [
      {
        name: 'dataManagementCarrierCommercialHouseList',
        path: '/dataManagement/carrierReduction/commercialHouse/list',
        meta: { id: '4B84' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/commercialHouse/list'
          )
      },
      {
        name: 'dataManagementCarrierCommercialHouseProcess',
        path: '/dataManagement/carrierReduction/commercialHouse/process',
        meta: { id: '4B84' },
        component: () =>
          import(
            '@/views/dataManagement/carrierReduction/commercialHouse/process'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'revenueProfit',
    id: '4B9',
    meta: { id: '4B9' },
    path: '/dataManagement/revenueProfit',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/dataManagement/revenueProfit/list',
    children: [
      {
        name: 'dataManagementRevenueProfitList',
        path: '/dataManagement/revenueProfit/list',
        meta: { id: '4B9' },
        component: () =>
          import(
            '@/views/dataManagement/revenueProfit/list'
          )
      }
    ]
  },
  {
    name: 'equityInvestment',
    id: '4B10',
    meta: { id: '4B10' },
    path: '/dataManagement/equityInvestment',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/dataManagement/equityInvestment/list',
    children: [
      {
        name: 'dataManagementEquityInvestmentList',
        path: '/dataManagement/equityInvestment/list',
        meta: { id: '4B10' },
        component: () =>
          import(
            '@/views/dataManagement/equityInvestment/list'
          )
      },
      {
        name: 'dataManagementEquityInvestmentAdd',
        path: '/dataManagement/equityInvestment/add',
        meta: { id: '4B10' },
        component: () =>
          import(
            '@/views/dataManagement/equityInvestment/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'fileManagement',
    id: '4Ba1',
    meta: { id: '4Ba1' },
    path: '/dataManagement/fileManagement',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/dataManagement/fileManagement/list',
    children: [
      {
        name: 'dataManagementFileManagementList',
        path: '/dataManagement/fileManagement/list',
        meta: { id: '4Ba1' },
        component: () =>
          import(
            '@/views/dataManagement/fileManagement/list'
          )
      },
      {
        name: 'dataManagementFileManagementAdd',
        path: '/dataManagement/fileManagement/add',
        meta: { id: '4Ba1' },
        component: () =>
          import(
            '@/views/dataManagement/fileManagement/add'
          ),
        props: (route) => ({
          pkid: route.query.pkid,
          title: route.query.title,
          data: route.query.data,
          isEdit: route.query.isEdit === 'true',
          isDetail: route.query.isDetail === 'true'
        })
      }
    ]
  },
  {
    name: 'industryFund',
    id: '4Bb1',
    meta: { id: '4Bb1' },
    path: '/dataManagement/industryFund',
    component: () =>
      import('@/components/layouts/contentLayout'),
    redirect: '/dataManagement/industryFund/list',
    children: [
      {
        name: 'dataManagementIndustryFundList',
        path: '/dataManagement/industryFund/list',
        meta: { id: '4Bb1' },
        component: () =>
          import('@/views/dataManagement/industryFund/list')
      }
    ]
  }
]

const childrenHeader = [
  {
    name: 'cockpit',
    path: '/cockpit',
    ids: ['41', '411', '412', '413', '414', '415'],
    component: () => import('@/views/cockpit/index.vue'),
    redirect:
      level === 3
        ? '/cockpit/panorama'
        : () => {
            return redirectF(childrenOne)
          },
    // redirect: '/cockpit/panorama',
    children: childrenOne
  },
  {
    name: 'decision',
    path: '/decision',
    ids: ['42', '421'],
    component: () => import('@/views/decision/index.vue')
  },
  {
    name: 'wisdomIndustry',
    path: '/wisdomIndustry',
    ids: ['49', '491', '492', '493', '494', '495'],
    component: () => import('@/views/wisdomIndustry/index'),
    redirect:
      level === 3
        ? '/wisdomIndustry/WisdomIndustryOverview'
        : () => {
            return redirectF(childNight)
          },
    children: childNight
  },
  {
    name: 'wisdomInnovation',
    path: '/wisdomInnovation',
    ids: ['46', '461', '462', '463', '464'],
    component: () =>
      import('@/views/wisdomInnovation/index'),
    redirect:
      level === 3
        ? '/wisdomInnovation/innovationOverview'
        : () => {
            return redirectF(childrenFive)
          },
    children: childrenFive
  },
  {
    name: 'wisdomPlanning',
    path: '/wisdomPlanning',
    ids: ['48', '481', '482', '483', '484', '485', '486'],
    component: () => import('@/views/wisdomPlanning/index'),
    redirect:
      level === 3
        ? '/wisdomPlanning/wisdomPlanningOverview'
        : () => {
            return redirectF(childrenSeven)
          },
    children: childrenSeven
  },
  {
    name: 'wisdomLand',
    path: '/wisdomLand',
    ids: ['47', '471', '472', '473', '474', '4743', '476'],
    component: () => import('@/views/wisdomLand/index'),
    redirect:
      level === 3
        ? '/wisdomLand/wisdomLandOverview'
        : () => {
            return redirectF(childrenSix)
          },
    children: childrenSix
  },
  {
    name: 'wisdomConstruction',
    path: '/wisdomConstruction',
    ids: [
      '45',
      '451',
      '452',
      '453',
      '454',
      '455',
      '456',
      '457'
    ],
    component: () =>
      import('@/views/wisdomConstruction/index'),
    redirect:
      level === 3
        ? '/wisdomConstruction/projectOverview'
        : () => {
            return redirectF(childrenFour)
          },
    children: childrenFour
  },
  {
    name: 'wisdomBuild',
    path: '/wisdomBuild',
    // ids: ['43', '431', '432', '433', '434', '435', '436'],
    ids: ['43', '431', '432', '433', '435', '436'],
    // ids: ['43', '432', '433', '435', '436'],
    component: () =>
      import('@/views/wisdomBuild/index.vue'),
    redirect:
      level === 3
        ? '/wisdomBuild/safe'
        : () => {
            return redirectF(childrenThree)
          },
    children: childrenThree
  },
  {
    name: 'wisdomOperation',
    path: '/wisdomOperation',
    ids: ['4A', '4A1', '4A2', '4A3', '4A4', '4A5', '4A6'],
    component: () =>
      import('@/views/wisdomOperation/index'),
    redirect:
      level === 3
        ? '/wisdomOperation/wisdomOperationOverview'
        : () => {
            return redirectF(childrenEight)
          },
    children: childrenEight
  },
  {
    name: 'mochaITOM',
    path: '/mochaITOM',
    ids: ['44', '441', '442', '443', '444', '445', '446'],
    component: () => import('@/views/mochaITOM/index'),
    redirect:
      level === 3
        ? '/mochaITOM/userManagement'
        : () => {
            return redirectF(childrenTwo)
          },
    children: childrenTwo
  },
  {
    name: 'dataManagement',
    path: '/dataManagement',
    // ids: ['4B', '4B1', '4B2', '4B3', '4B4', '4B5', '4B6'],
    ids: [
      '4B',
      '4B1',
      '4B2',
      '4B3',
      '4B4',
      '4B5',
      '4B6',
      '4B7',
      '4B8',
      '4B9',
      '4B10',
      '4Ba1',
      '4Bb1',
      '4B-4'
    ],
    component: () => import('@/views/dataManagement/index'),
    redirect:
      level === 3
        ? '/dataManagement/projectManagement/investProjectInfo'
        : () => {
            return redirectF(childrenTen)
          },
    children: childrenTen
  }
]

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import('@/views/layout/index.vue'),
    redirect:
      // level === 3
      //   ? '/cockpit'
      //   : () => {
      //       return redirectH(childrenHeader)
      //     },
      () => {
        return redirectH(childrenHeader)
      },
    children: childrenHeader
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/detail',
    name: 'detail',
    component: () => import('@/views/detail/index.vue')
  },
  {
    path: '/noticeDetail',
    name: 'noticeDetail',
    component: () => import('@/views/detail/notice.vue')
  },
  {
    path: '/loginFrom',
    name: 'loginFrom',
    component: () => import('@/views/loginFrom/index.vue')
  },
  {
    path: '/loginFromPlatform',
    name: 'loginFromPlatform',
    component: () =>
      import('@/views/loginFromPlatform/index.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/index.vue')
  }
]

const router = new VueRouter({
  base: process.env.BASE_URL,
  routes
})

router.beforeEach((to, from, next) => {
  const token = cacheUtil.getItem('token')
  const moduleTree = JSON.parse(
    localStorage.getItem('menu')
  )
  if (
    to.path !== '/login' &&
    to.path !== '/loginFrom' &&
    to.path !== '/loginFromPlatform' &&
    to.path !== '/home'
  ) {
    if (!token) {
      if (
        to.name === 'detail' ||
        to.name === 'noticeDetail'
      ) {
        next()
      } else {
        next('/login')
      }
    } else {
      if (
        to &&
        to.meta &&
        to.meta.id &&
        moduleTree &&
        moduleTree.length
      ) {
        const result = checkMenu(moduleTree, to.meta.id)
        if (!result) {
          Message.warning('该用户没有访问权限')
          next({ ...from, replace: true })
          return false
        }
      }
      const matchedPath = [...to.matched].pop()?.path || ''
      if (to.matched && matchedPath !== to.path) {
        // && from.path === '/login'
        Message.warning('账号没有权限，请联系管理员。')
        next({ path: '/login', replace: true })
      } else {
        next()
      }
    }
  } else {
    next()
  }
})

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {
  return originalPush
    .call(this, location)
    .catch((err) => err)
}

export default router
